package prickworlds.structure;

/**
 * Event that is sent when a mouse event occurs
 * 
 * @author Faruk Acibal, Richard Dziambor, Christian Holzreuter, Nicolas Winkler
 * 
 */
public class MouseEvent implements Event {
	/**
	 * Type of the Event
	 * 
	 * @author Faruk Acibal, Richard Dziambor, Christian Holzreuter, Nicolas
	 *         Winkler
	 * 
	 */

	public static enum Type {
		NO_EVENT,
		MOVE,
		LEFT_DOWN,
		LEFT_UP,
		RIGHT_DOWN,
		RIGHT_UP
	}

	/**
	 * the type
	 */
	public Type type;

	/**
	 * the x coordinate of the mouse position
	 */
	public int x;

	/**
	 * the y coordinate of the mouse position
	 */
	public int y;

	/**
	 * default constructor
	 */
	public MouseEvent() {
		type = Type.NO_EVENT;
	}

	/**
	 * invalidates the event
	 */
	@Override
	public void invalidate() {
		type = Type.NO_EVENT;
	}

	/**
	 * returns true if the event is valid which means, he has never been
	 * invalidated
	 */
	@Override
	public boolean isValid() {
		return type != Type.NO_EVENT;
	}
}